Not able to find scripts present in /etc/profile.d directory [on hold]

Posted by priya on Super User See other posts from Super User or by priya
Published on 2013-10-31T14:13:33Z Indexed on 2013/11/04 15:59 UTC
Read the original article Hit count: 339

Filed under:
|

I am using Red Hat Linux 6.0 ... using davinchi board. I have to change system clock resolution so I am changing (HZ) env var. For this I have written script so that I can change HZ = 1000 n insert that script in /etc/profile.d and write code for loop in /etc/profile so that while running as usual /etc/profile can load the scripts present in /etc/profile.d. But when I am logging into the system at root level then showing error as "-bash: ./etc/profile.d/resolution.sh(my script name): No such file or directory

Also here why it is showing ./etc and not /etc . Is something related to that??

Also I tried to add script in /etc/init.d but still no change in value of HZ takes place. Please tell where to change so that this env var can get changed.

The script(resolution.sh) written has :-

#!/bin/bash
export HZ=1000

The content of /etc/profile which I entered is:

if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
        if [ -r $i ]; then
            .$i
        fi
    done
    unset i
fi

And the output of grep command is

-rw-r--r-- 1 root root  535 Feb 4 2004 profile
-rwxr-xr-x 2 root root 4096 Feb 2 2004 profile.d

© Super User or respective owner

Related posts about shell-script

Related posts about linux-kernel